feat(eew): announce predicted intensity before warning sound - #546
Conversation
|
記得要 rebase before merging |
ad76de1 to
1f489c4
Compare
|
|
@archie0732 另外剛創 https://github.com/ExpTechTW/flutter_tts 可以開PR |
maplibre_gl 那條路我沒想到,fork 確實是這個 repo 既有的做法。上游那三個 PR 從 5 月放到現在都沒合,等作者應該是等不到了。 不過在你留言之前我已經先改成 app 自有的 channel 了(c537a540),所以想先把兩個方案的現況擺出來,你決定要哪一個我照做。 現在這版(自有 channel) com.exptech.dpip/speech,SpeechPlugin.swift + SpeechChannel.kt,兩邊各約 30 行,跟現有的 CompassPlugin / ScreenWakeChannel 同一個模子 保留完整功能,之後要調語速那類的不用再寫原生 另外不論走哪條路,我沒有 Mac,iOS 端的執行期行為(語音真的出得來、audio session 不會蓋掉別的 app)都要麻煩有裝置的人幫忙看一下。 你說走 fork 我就把 c537a54 拿掉改成 git 相依,覺得自有 channel 可以就維持現狀。 |
|
等 @whes1015 起床再看方案說法 經過測試iOS模擬器有說話 預估所在地震度 |
|
五弱 五強 六弱 六強的部份,有需要加「等級」嗎?因為地牛是直接五弱 這樣感覺贅字也比較少 |
我覺得用 fork 比較合適,追上游問題不大,如果 iOS / Android 沒有對 flutter_tts 的 breaking change ,不追也沒關係。 |
這個我在程式碼那裡有說明: 主要是我用模擬器聽的時候句子會斷,像是「所在地預估震度,五弱。」。Google 的 zh-TW 語音會把句尾那個 弱 / 強 吃掉,而且它還是回報「已念完」。實際上聽到的是「所在地預估震度,五」—— 五級跟五弱差很多。不過主要還是看你們的偏好,這裡都可以在調。 |
ok,#546 |
|
移植上游 dlutton/flutter_tts#651(作者 @shivanshu877),用 cherry-pick 保留原作者署名,13 檔案 +62 −26,與該 PR 一字不差。base 就是 fork 的 沒有 macOS 環境,所以完全沒有實際建置過。 只做了靜態檢查:
合併前需要有 Mac 的人跑一次 這個 PR 接下來等 #1 合併之後:
想先確認一件事:#546 要等 #1 合併,還是先用 pub.dev 的 另外@BigDuck430 提的語音開關已經做好了在 「更多 → 通知」那裡多一個開關,預設開,整列都可以點。關掉時會停掉正在播報的語音,關開關應該永遠不會延後警報,最壞情況是警報比平常早響。 目前實作在 |
c537a54 to
2201218
Compare
New(zh-Hant): 強震監視器會先朗讀地震預估震度,再播放警示音 New(en-US): the seismic monitor announces predicted intensity before the warning sound
Platform: android
A pull request opened from a fork is handed no repository secrets, so `secrets.KEYSTORE_BASE64` and its three companions arrive as the empty string. The job still decoded them: it wrote a zero-byte android/app/my-release-key.jks and an android/key.properties whose four values were blank, and Gradle then died inside packageRelease on a keystore it could not read. Nothing in that failure names a fork, and every other check on the same commit passes — the iOS build included, because it never codesigns. This job was never the one that signs. The header of this file already says so: release.yml builds the signed, uploadable artifact on a push to main, and what comes out of here is the copy nobody installs. So the keystore is dropped rather than guarded. android/app/build.gradle.kts already falls back to the debug signing config when android/key.properties is absent, which makes the pull-request APK the same release build, debug-signed.
New(zh-Hant): 「更多 → 通知」可以關閉強震監視器朗讀預估震度的語音 New(en-US): the monitor's spoken intensity announcement can be switched off under More → Notifications New(ja-JP): 強震モニタの予想震度の読み上げを「その他 → 通知」でオフにできます
2201218 to
12b5720
Compare
|
@archie0732 |
ok了解,我晚點來用 |
|
關於你說的第2點和第3點我目前都改好了。 關於第1點想跟你確認一下位置,在更多那裡沒有看到無障礙這個區塊: 更多現在的分區是 地區 / 通知 / 顯示 / Mesh 網路 / 進階 / 相關連結 / 取得 App / 測試版 / 合作夥伴 / 關於。 我剛剛找了一下:無障礙相關的設定: 色覺調整、對比、文字大小、字重是放在顯示設定裡。 目前我是有想到兩種解法:
看你們的偏好,我都可以配合,不過我的多益還沒讀完可能要約兩個小時才會在做修改就是了😅 |
可以創新的區域 |
這個 PR 做了什麼
在強震監視器顯示於前景時,以系統 TTS 朗讀最新 EEW 預估震度,朗讀完成後才播放原有警示音;新報會中斷舊播報並改讀最新結果。可在「更多 → 通知」關閉。
相關 issue
四則 commit
feat(eew): announce predicted intensity before warning soundflutter_tts的 git 相依build(android): include x86_64 in debug buildsci(android): build the pull-request APK without the release keystorefeat(eew): let the user turn off the spoken intensity announcement怎麼驗
手動測試(Android Emulator,x86_64)
進入「雷達」,切換為「強震監視器」:
MethodChannel.Result只回一次)自動測試
tool/check/commits.sh upstream/main..HEAD:4 commits 通過tool/dev/analyze.sh:flutter analyze無問題tool/check/l10n.sh、layering.sh、storage.sh、notification_sounds.shtest/tool/*在 Windows 上有 55 個失敗(Git Bash 把路徑轉成D:GitHub...),另有一個semantics_overlay_portal_test失敗——該檔案本次未修改且在 CI 上為綠。安全關鍵的部分
播報只在前景、可見的監視器上發生;背景與終止狀態的推播完全不經過這個閘門。TTS 引擎不存在或卡住時有兩層逾時(控制器 8 秒、通知閘門 10 秒),任何情況下都不會讓警示通知被無限期壓住——最壞情況是警報比平常早響,不會晚。feed 進入 stale/offline 時直接停止播報。關閉開關走的是同一條路徑:停掉語音並釋放閘門扣住的通知。
尚未驗證
iOS 完全沒有實機或模擬器測試,開發環境為 Windows。
flutter_tts取自 ExpTechTW 的 fork(見下),該 fork 的 Swift Package Manager 支援也只做過靜態檢查,沒有被任何編譯器看過。本 PR 的 iOS CI job 是它第一次實際建置。相依:為什麼用 fork
flutter_tts不支援 Swift Package Manager,而本專案的 iOS 端不使用 CocoaPods(README → 參與開發)。Flutter 每次建置都警告並說明「will become an error in a future version」,在那之前它會透過相依關係把 Podfile 帶回專案。上游
dlutton/flutter_tts從 2026-05 起有三個功能相同的 SPM PR(#631、#634、#651)都未合併,因此改用ExpTechTW/flutter_tts,內容是移植 #651(作者 @shivanshu877,cherry-pick 保留署名)。釘在 fork master 的a9cd6eda,比照maplibre_gl的做法。檢查清單
tool/check/commits.sh origin/main..HEAD通過flutter analyze通過;新增測試全數通過AppLocalizations,沒有寫死(含新增的粵語app_yue.arb)_MoreTile,未引入新的樣式